// import { connect } from "react-redux"
import { Routes, Route } from "react-router-dom"
import React, { Suspense } from "react"
const Home = React.lazy(() => import("../src/views/Home.jsx"))
const Info = React.lazy(() => import("../src/views/Info.jsx"))
const Car = React.lazy(() => import("../src/views/Car.jsx"))
function App(props) {
  return (
    <div>
      <Suspense>
      <Routes>
          <Route path="/" element={<Home></Home>}></Route>
          <Route path="/info/:id" element={<Info></Info>}></Route>
          <Route path="/car" element={<Car></Car>}></Route>
      </Routes>
      </Suspense>
      {/* {props.my}
      <button onClick={() => props.add()}></button> */}
    </div>
  );
}

//class 组件
// class App extends React.Component {
//   render() {
//     return <div>
//       {this.props.属性名}

//       <button onClick={() => this.props.方法名()}></button>
//     </div>

//   }
// }
// const mapStateToProps = (state) => {
//   return {
//     my: state
//   }
// }
// const mapDispatchToProps = (dispatch) => {
//   return {
//     add: () => dispatch({ type: "jia" })

//   }
// }
// export default connect(mapStateToProps, mapDispatchToProps)(App);

export default App;